<template>
	<view class="">
		<u-navbar :is-back="true" :border-bottom="false" title="在线简历" height="46" title-color="#333" :title-bold="true"
			:title-size="36">
			<view class="navbar_wap">
				<view class="navbar-right">
					<u-icon name="search" color="#C40200" size="45" class="search_logo" @click="goSearch"></u-icon>
					<u-icon name="scan" color="#C40200" size="45" @click="scancode"></u-icon>
				</view>
			</view>
		</u-navbar>
		<view class="resume_banner">
			<image src="@/static/index/resume/banner.png" mode="widthFix"></image>
		</view>
		<!-- 	<view class="resume_tsfw">
			<view class="resume_text">
				特色服务
			</view>
			<view class="resume_img">
				<image src="../../../static/index/resume/zygh.jpg" mode="widthFix"></image>
				<image src="../../../static/index/resume/jlfw.jpg" mode="widthFix"></image>
				<image src="../../../static/index/resume/msfd.jpg" mode="widthFix"></image>
			</view>
		</view> -->
		<my-resume :resumeMyData="resumeMyData" :MyDatashow="MyDatashow" @getChild1="getChild1"
			style="padding-bottom: 30rpx;"></my-resume>
		<!-- <case-resume></case-resume> -->
		<u-gap height="20" bg-color="#F7F7F7"></u-gap>
		<class-resume @myChange="myChange" :resumelist="resumelist"></class-resume>
		<!-- <u-gap height="20" bg-color="#F7F7F7"></u-gap> -->
		<!-- <cooper-resume /> -->

	</view>
</template>

<script>
	import MyResume from "./chidComps/MyResume.vue"
	import CaseResume from "./chidComps/CaseResume.vue"
	import ClassResume from "./chidComps/ClassResume.vue"
	import CooperResume from "./chidComps/CooperResume.vue"
	export default {
		data() {
			return {
				ssfl: "公共事业",
				resumelist: [],
				resumeMyData: [],
				MyDatashow: "",
				grjb: [{
						id: 1,
						name: "普通工人",
					},
					{
						id: 2,
						name: "专业人才",
					},
					{
						id: 3,
						name: "高级管理人才",
					},
					{
						id: 4,
						name: "项目管理团队",
					}
				]
			}
		},
		async onLoad() {
			await this.resumedata()
			await this.resumemy()
			uni.$on('resumeData', () => {
				this.resumemy()
			})
		},
		methods: {
			getChild1(e) {
				if (e == 1) {
					this.resumemy()
				}
			},
			async resumedata() {
				let params = {
					cmd: 'lResTemp_list',
					para: {
						"pagesize": 4,
						"pageindex": 1,
						"ssfl": this.ssfl
					}
				}
				const res = await this.$u.api.resumedata(params)
				this.resumelist = res.Data.Data
				for (var value of this.resumelist.values()) {
					value.slt = this.baseUrl + value.slt
				}
			},
			async resumemy() {

				if (this.$store.state.token) {
					let params = {
						ak: this.$store.state.token,
						cmd: 'lPeople_mylist',
						para: {
							"pagesize": 3,
							"pageindex": 1,
						}
					}
					const res = await this.$u.api.resumedata(params)

					if (res.Data.Data) {
						this.resumeMyData = res.Data.Data

						for (var value of this.resumeMyData.values()) {
							value._updatetime = this.$u.timeFormat(value._updatetime, 'mm-dd hh:MM');
							if (value.tx) {
								if (value.tx.indexOf('http') == -1) {
									value.tx = this.baseUrl + value.tx
								} else {
									value.tx = value.tx
								}
							}
							value.grjb = value.grjb != 0 ? this.grjb.filter(item => item.id == value.grjb)[0].name : ""
						}
						this.MyDatashow = true
					} else {
						this.MyDatashow = false
					}
				} else {
					this.MyDatashow = false
				}

			},
			myChange(e) {
				// console.log(e)
				this.ssfl = e
				this.resumedata()
			},
			goSearch() {
				uni.navigateTo({
					url: "/pages/HomeLnner/search/search"
				})
			}
		},
		components: {
			"my-resume": MyResume,
			"case-resume": CaseResume,
			"class-resume": ClassResume,
			"cooper-resume": CooperResume
		}
	}
</script>

<style scoped lang="scss">
	.navbar_wap {
		width: 100%;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		padding: 0 30rpx;

		.navbar-right {
			.search_logo {
				margin-right: 30rpx;
			}
		}
	}

	.resume_banner {
		padding: 0 30rpx;

		image {
			width: 100%;
		}
	}

	.resume_tsfw {
		padding: 40rpx 30rpx 0 30rpx;

		.resume_text {
			font-size: 32rpx;
			font-weight: bold;
		}

		.resume_img {
			margin-top: 40rpx;
			margin-bottom: 40rpx;
			display: flex;
			justify-content: space-between;

			image {
				width: 30%;

				&:first-child {
					box-shadow: 0rpx 40rpx 50rpx -30rpx rgba(#499AFF, 0.6);
				}

				&:nth-child(2) {
					box-shadow: 0rpx 40rpx 50rpx -30rpx rgba(#D7A14C, 0.6);
				}

				&:nth-child(3) {
					box-shadow: 0rpx 40rpx 50rpx -30rpx rgba(#05B8AF, 0.6);
				}
			}
		}
	}
</style>
